import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:tiktokadult/assets_tool/app_colors.dart';
// import 'package:tiktokadult/hj_utils/global.dart';
import 'package:tiktokadult/hj_utils/widget_utils.dart';
import 'package:tiktokadult/tools_base/loading/loading_center_widget.dart';

class LoadingHelper {
  static void showLoading({bool dismissiable = false, String msg = ''}) {
    // LoadingAlertWidget()

    Get.dialog(
      Scaffold(
        backgroundColor: Colors.transparent,
        body: Center(
          child: Column(
            mainAxisSize: MainAxisSize.min,
            children: [
              const LoadingCenterWidget(),
              if (msg.isNotEmpty) ...[
                4.sizeBoxH,
                Text(
                  msg,
                  style: textStyle(16, AppColors.mainTextColor33, FontWeight.w500),
                ),
              ]
            ],
          ),
        ),
      ),
      barrierColor: Colors.transparent,
      barrierDismissible: dismissiable,
    );
  }

  static void dismissLoading() {
    Get.back();
  }
}
